<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<title>simCreateProximitySensor</title>
<link rel="stylesheet" type="text/css" href="../../style.css">
</head>

<body>

<div align="center">
<table class=allEncompassingTable >
 <tr>
  <td >
<p><a href="../../index.html" TARGET="_top"><img src="../images/homeImg.png"></a></p>

<h1>Regular API function</h1>
<h3 class=subsectionBar><a name="simCreateProximitySensor" id="simCreateProximitySensor"></a>simCreateProximitySensor / sim.createProximitySensor </h3>
<table class=apiTable>
<tr class=apiTableTr> 
<td class=apiTableLeftDescr>
Description 
</td> 
<td class=apiTableRightDescr>Creates a <a href="../proximitySensors.htm">proximity sensor</a>. <br></td>
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCSyn>
C synopsis
</td> 
<td class=apiTableRightCSyn>simInt simCreateProximitySensor(simInt sensorType,simInt subType,simInt options,const simInt* intParams,const simFloat* floatParams,const simFloat* color)<br></td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCParam>C parameters</td> 
<td class=apiTableRightCParam>
<div><strong>sensorType</strong>: the desired <a href="../apiConstants.htm#sceneObjectSubTypes">proximity sensor type</a> (e.g. sim_proximitysensor_cone_subtype)</div>
<div><strong>subType</strong>: deprecated. Set to 16</div>
<div><strong>options</strong>: bit-coded options:</div>
<div class=tab>bit 0 set (1): the sensor will be explicitely handled</div>
<div class=tab>bit 1 set (2): the detection volumes are not shown when detecting something</div>
<div class=tab>bit 2 set (4): the detection volumes are not shown when not detecting anything</div>
<div class=tab>bit 3 set (8): front faces are not detected</div>
<div class=tab>bit 4 set (16): back faces are not detected</div>
<div class=tab>bit 5 set (32): fast detection (i.e. not exact detection)</div>
<div class=tab>bit 6 set (64): the normal of the detected surface with the detection ray will have to lie below a specified threshold angle</div>
<div class=tab>bit 8 set (256): smallest distance threshold will be active</div>
<div class=tab>bit 9 set (512): randomized detection (only with ray-type proximity sensors)</div>
<div><strong>intParams (input)</strong>: 8 integer parameters:</div>
<div class=tab>intParams[0]: face count (volume description)</div>
<div class=tab>intParams[1]: face count far (volume description)</div>
<div class=tab>intParams[2]: subdivisions (volume description)</div>
<div class=tab>intParams[3]: subdivisions far (volume description)</div>
<div class=tab>intParams[4]: randomized detection, sample count per reading</div>
<div class=tab>intParams[5]: randomized detection, individual ray detection count for triggering</div>
<div class=tab>intParams[6]: reserved. Set to 0</div>
<div class=tab>intParams[7]: reserved. Set to 0</div>
<div><strong>floatParams (input)</strong>: 15 floating point parameters:</div>
<div class=tab>floatParams[0]: offset (volume description)</div>
<div class=tab>floatParams[1]: range (volume description)</div>
<div class=tab>floatParams[2]: x size (volume description)</div>
<div class=tab>floatParams[3]: y size (volume description)</div>
<div class=tab>floatParams[4]: x size far (volume description)</div>
<div class=tab>floatParams[5]: y size far (volume description)</div>
<div class=tab>floatParams[6]: inside gap (volume description)</div>
<div class=tab>floatParams[7]: radius (volume description)</div>
<div class=tab>floatParams[8]: radius far (volume description)</div>
<div class=tab>floatParams[9]: angle (volume description)</div>
<div class=tab>floatParams[10]: threshold angle for limited angle detection (see bit 6 above)</div>
<div class=tab>floatParams[11]: smallest detection distance (see bit 8 above)</div>
<div class=tab>floatParams[12]: sensing point size</div>
<div class=tab>floatParams[13]: reserved. Set to 0.0</div>
<div class=tab>floatParams[14]: reserved. Set to 0.0</div>
<div><strong>color</strong>: pointer to 4x4x3 values representing the various colors of the sensor ((passive, active, ray, closest distance) x (ambient_diffuse rgb, 3 reserved values (set to zer0), specular rgb and emission rgb)). Can be nullptr for default values<br>
</div>
</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCRet>
C return value
</td> 
<td class=apiTableRightCRet>
<div>-1 if operation was not successful, otherwise the handle of the force sensor</div>
</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLSyn>
Lua synopsis
</td> 
<td class=apiTableRightLSyn>int sensorHandle=sim.createProximitySensor(int sensorType,int subType,int options,table[8] intParams,table[15] floatParams,table[48] color=nil)<br></td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLParam>Lua parameters</td> 
<td class=apiTableRightLParam>
<div>Similar to the C-function counterpart</div>
<div></div></td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLRet>
Lua return values
</td> 
<td class=apiTableRightLRet>
<div>Similar to the C-function counterpart</div>
<div></div>
</td> 
</tr> 
</table> 


<br>
</td>
</tr>
</table>
</div>
</body>
</html>
